﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ImageProcessing.Forms
{
    public partial class NewImage : Form
    {
        Color color;

        public Color Color
        {
            get { return color; }
        }

        public NewImage()
        {
            InitializeComponent();
            color = Color.White;
        }

        private void panel1_Paint(object sender, PaintEventArgs e)
        {

        }

        private void panel1_Click(object sender, EventArgs e)
        {
            ColorDialog dialogColor = new ColorDialog();
            Color clr = new Color();
            if (dialogColor.ShowDialog() == DialogResult.OK)
            {
                clr = dialogColor.Color;
            }

            this.panel1.BackColor = clr;
            this.color = clr;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void Btn_Ok_Click(object sender, EventArgs e)
        {
            Main.Instance.CreateNewImage(int.Parse(Txt_Height.Text), int.Parse(Txt_Width.Text), Color, Txt_Name.Text);
            this.Close();
        }
    }
}
